﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

using System.Windows;
using System.Windows.Controls;

namespace TheOliver.DigitalSignage.Admin.Controls
{
    public partial class QuestionWindow : ChildWindow
    {
        public delegate void SimpleMethod();
        SimpleMethod _methodToCall;

        public QuestionWindow(string question, SimpleMethod methodToCall)
        {
            InitializeComponent();

            _question.Text = question;
            _methodToCall = methodToCall;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            _methodToCall.Invoke();
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

